using IuliiaBot.Application.Interfaces;
using Telegram.Bot;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;

namespace IuliiaBot.Telegram;
public class TelegramSander : ISander
{
    protected readonly ITelegramBotClient _botClient;
    protected readonly Update _update;

    public async Task<bool> SandMessage(string text)
    {
        var message = _update.Message;
        var chat = message!.Chat;

        await _botClient.SendTextMessageAsync(
            chat.Id,
            text,
            parseMode: ParseMode.Html,
            replyToMessageId: message.MessageId
        );

        return true;
    }

    public TelegramSander(ITelegramBotClient botClient, Update update)
    {
        _botClient = botClient;
        _update = update;
    }
}